/*
 * @Author: Wangtao
 * @Date: 2022-06-27 20:11:38
 * @LastEditors: Wangtao
 * @LastEditTime: 2022-07-13 14:23:04
 */
const { defineConfig } = require('@vue/cli-service')
const path = require('path')
// element-plus按需引入 start
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
// element-plus按需引入 end
module.exports = defineConfig({
  transpileDependencies: true,
  chainWebpack: (config) => {
    config.resolve.alias // 添加别名
      .set('@', path.resolve(__dirname, 'src'))
      .set('@app', path.resolve(__dirname, 'src/app'))
      .set('@common', path.resolve(__dirname, 'src/common'))
  },
  configureWebpack: {
    plugins: [
      AutoImport({
        resolvers: [ElementPlusResolver()]
      }),
      Components({
        resolvers: [ElementPlusResolver()]
      })
    ]
  }
})
